﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OpenFile
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入要打开文件的路径:");
            string path = Console.ReadLine();
            DirectoryInfo file = new DirectoryInfo(path);
            if (file.Exists)
            {
                Console.WriteLine("请输入要打开文件的名字:");
                string fileName = Console.ReadLine();

                BaseFile bf = Factory.GetFile(path, fileName);
                if (bf != null)
                {
                    bf.OpenFile();
                }
            }
                
        }
    }
}
